-
-
Notifications
You must be signed in to change notification settings - Fork 624
fetch api: add support for downloading raw response #4917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
... to make it easier to find the docs from methods that use it.
I need to make an authenticated request to the media repo, and expect to get a binary file back. AFAICT there is no easy way to do that right now.
d0ea3cc
to
32a0c1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm reading the types correctly, could the same not be achieved using onlyData=false json=false and adding a blob
method to TypedResponse
given res
already sports this method it just isn't exposed in the interface.
Yes, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay but ResponseType
does not consider rawResponseBody
so the types will only be right if onlyData=true
or undefined, which does not match your comment which says rawResponseBody
inhibits the behaviour of onlyData
- as with rawResponseBody=true & onlyData=false
(or json=false frankly) you would have a return type of TypedResponse
(or string in the json=false) case
The types for rawResponseBody
also do not inhibit you from entering this edge case, where they could/should.
I need to make an authenticated request to the media repo, and expect to get a binary file back. AFAICT there is no easy way to do that right now.